package com.dctp.common.db;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

public class FuturesDb {
    public static Record findById(Long futuresId) {
        return Db.findFirst("SELECT * FROM dctp_futures WHERE id = ?", futuresId);
    }
    public static void update(Long futuresId, Record futures) {
        Db.update("dctp_futures", "id", futures);
    }
    public static void delete(Long futuresId) {
        Db.update("DELETE FROM dctp_futures WHERE id = ?", futuresId);
    }
    public static Record findByCode(String code) {
        return Db.findFirst("SELECT * FROM dctp_futures WHERE code = ?", code);
    }
}
